<?php
/**
 * IndexController
 *
 * PHP Version 5.4
 *
 * @author liuxuTJ <liuxuphp@icesmart.cn>
 */
namespace Admin\Controller;
use Admin\Service\PermissionService;
use Admin\Service\UserService;
use Think\Controller;

/**
 * Class IndexController
 */
class IndexController extends BaseController {

    public function __construct()
    {
        parent::__construct();
        $userService = new UserService();
        $userInfo = $userService->validateLogin();   //验证是否登录

        $permissionService = new PermissionService();
        $menu = $permissionService->menu($userInfo['userId']);

        $this->assign('menu', $menu);
        $this->assign('userInfo', $userInfo);
    }

    public function index()
    {
        $this->display();
    }
}